home *** CD-ROM | disk | FTP | other *** search
- /* test.ilbmer
- * Little macro to test ARexx error processing
- * Written by David N. Junod
- *
- */
-
- OPTIONS RESULTS
- OPTIONS FAILAT 10
- PARSE ARG in_file out_file
-
- Main:
-
- /* I'm talking to you! */
- SAY ADDRESS
- ADDRESS ILBMER.1
-
- /* Open the input file. If no name was provided, then ILBMer will
- * open a file requester */
- "Open" in_file
-
- /* Successful? */
- IF RC = 0 THEN DO
-
- /* Indicate mode */
- "SetMode Image"
-
- /* Save the brush as C source. If no name was provided, then
- * ILBMer will open a file requester. */
- "SaveAs" out_file
-
- /* Error? */
- IF RC > 0 THEN CALL ShowError()
-
- /* Free the memory that it used */
- "Clear"
-
- END
-
- ELSE CALL ShowError()
-
-
- RETURN
- /* End of main routine */
-
- ShowError: PROCEDURE EXPOSE ILBMER.
-
- /* Get the text associated with the error */
- "Why"
-
- /* Display the error number and text */
- SAY "Error #:" ILBMER.LastError||"," RESULT
-
- RETURN
- /* End of ShowError() */
-